package com.example.myspringpro.service.impl;

import com.example.myspringpro.entity.User;
import com.example.myspringpro.service.UserService;
import com.example.myspringpro.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.io.Serializable;
import java.util.List;

/**
 * @Description
 * @Author allenhu <huxiangneng@163.com>
 * @Date 2019/04/30
 * @Version V1.0.0
 **/
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;

    @Override
    public User selectUserByName(String name) {
        return userDao.findUserByName(name);
    }

    @Override
    public List<User> selectAllUser() {
        return userDao.findAllUser();
    }

    @Override
    public int insertUser(User user) {
        return userDao.insertUser(user);
    }

    @Override
    public void deleteService(int id) {
        userDao.deleteUser(id);
    }
}
